package sharedGameLogic.players;

/**
 * The Player class represents a player (user) of the game.
 * He/she has a name or nickname and a character he is playing as.
 * 
 * @author Tobias
 *
 */
import java.io.Serializable;



public final class Player implements Serializable, Cloneable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 606084794473506319L;
	private String playerName;
	private Character character;
	
	/**
	 * Constructor for Player objects.
	 * 
	 * @param name - The players name or nickname a
	 * @param character - 
	 */
	public Player(String name, Character character){
		playerName = name;
		this.character = character;
	}
	
	/**
	 * Accessor method that returns the name 
	 * of the described player
	 * @return - The name of the player
	 */
	public String getPlayerName(){
		return playerName;
	}
	
	/**
	 * 
	 * @return
	 */
	public Character getCharacter(){
		return character;
	}
	
	@Override
	public Object clone(){
		return new Player(playerName, (Character)this.character.clone());
	}
}
